package com.easy.concert.repository;

import com.easy.common.bean.ConcertBean;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import java.util.List;
@Mapper
public interface ConcertRepository {

    // 按关键词搜索（标题、艺人）
    @Select(value = "SELECT * FROM concert WHERE " +
            "title LIKE CONCAT('%','${keyword}', '%') OR " +
            "artist LIKE CONCAT('%','${keyword}', '%')")
    List<ConcertBean> searchByKeyword(@Param("keyword") String keyword);

    // 获取推荐演唱会（按时间排序）
    @Select(value = "SELECT * FROM concert ORDER BY startdate ASC")
    List<ConcertBean> findRecommended();
}
